package com.sen.organization.feign.fallback;

import com.sen.common.common.bo.PeopleInfo;
import com.sen.common.common.response.MessageResult;
import com.sen.common.common.response.ResultMsgEnum;
import com.sen.organization.feign.MemberPeopleFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author esjiang
 */
@Component
public class MemberPeopleFeignFallbackFactory implements FallbackFactory<MemberPeopleFeign> {
    @Override
    public MemberPeopleFeign create(Throwable throwable) {
        return new MemberPeopleFeign() {

            @Override
            public MessageResult<PeopleInfo> getPeopleInfoByLogin(String userName) {
                return MessageResult.bizFailed(ResultMsgEnum.SERVICE_EXCEPTION);
            }
        };
    }
}
